<?php

/** 
 * @property Umeng_mdl $umeng
 */
class Umeng extends Admin_Controller {
	public function __construct() {
		parent::__construct ();
		$this->load->model('Umeng_mdl','umeng');
	}
	/**
	 * 广播消息
	 */
	public function broadcast(){
		if ( empty($_POST) ) {
			$this->showView('admin/umeng/push');
			return TRUE;
		}
		$ticker 	= $this->input->post_get('ticker',TRUE);
		$title 		= $this->input->post_get('title',TRUE);
		$text 		= $this->input->post_get('text',TRUE);
		$os  		= $this->input->post_get('os',TRUE);
		$afterOpen 	= $this->input->post_get('afterOpen',TRUE);
		$url 		= $this->input->post_get('url',TRUE);
		
		$text .= '['.date('Y-m-d H:i:s').']';
		
		$result = $this->umeng->setOS($os)->broadcast($text,$ticker,$title,$afterOpen,$url);
		$msg    = $result ? '操作成功':'操作失败';
		alert($msg,'back'); 
	}
	
	
	
	
	
}

